From: Alexandre Emsenhuber Date: Sat, 11 Sep 2010 14:21:34 +0000 (+0000) Subject: Don't use echo in maintenance scripts that extends the Maintenance class X-Git-Tag: 1.31.0-rc.0~35005 X-Git-Url: http://git.cyclocoop.org//%22http:/%22.attribut_html%28%24lesurls%5B%24numero%5D%29.%22/%22?a=commitdiff_plain;h=d383edea465f29d2d5a0e34b3a154c2c5a1144b1;p=lhc%2Fweb%2Fwiklou.git Don't use echo in maintenance scripts that extends the Maintenance class --- diff --git a/maintenance/minify.php b/maintenance/minify.php index 6b942913a4..5357ff1d11 100644 --- a/maintenance/minify.php +++ b/maintenance/minify.php @@ -48,13 +48,12 @@ class MinifyScript extends Maintenance { $inDir = dirname( $inPath ); if ( strpos( $inName, '.min.' ) !== false ) { - echo "Skipping $inName\n"; + $this->error( "Skipping $inName\n" ); continue; } if ( !file_exists( $inPath ) ) { - $this->error( "File does not exist: $arg" ); - exit( 1 ); + $this->error( "File does not exist: $arg", true ); } $extension = $this->getExtension( $inName ); @@ -80,7 +79,7 @@ class MinifyScript extends Maintenance { public function minify( $inPath, $outPath ) { $extension = $this->getExtension( $inPath ); - echo basename( $inPath ) . ' -> ' . basename( $outPath ) . '...'; + $this->output( basename( $inPath ) . ' -> ' . basename( $outPath ) . '...' ); $inText = file_get_contents( $inPath ); if ( $inText === false ) { @@ -103,7 +102,7 @@ class MinifyScript extends Maintenance { fwrite( $outFile, $outText ); fclose( $outFile ); - echo " ok\n"; + $this->output( " ok\n" ); } }